From 9ecb34b4a00f4621d4a1b8266544c779b3da9ef5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 18 Nov 2016 07:42:49 -0500 Subject: [PATCH] Add some drawing information the migration guide Mention snapshot(), and the new GtkDrawingArea API. --- docs/reference/gtk/migrating-3to4.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/reference/gtk/migrating-3to4.xml b/docs/reference/gtk/migrating-3to4.xml index 2638c7d9dc..e8ce2aaaef 100644 --- a/docs/reference/gtk/migrating-3to4.xml +++ b/docs/reference/gtk/migrating-3to4.xml @@ -149,6 +149,27 @@ +
+ Adapt to drawing model changes + + This area has seen the most radical changes in the transition from GTK+ 3 + to GTK+ 4. Widgets no longer use a draw() function to render their contents + to a cairo surface. Instead, they have a snapshot() function that creates + one or more GskRenderNodes to represent their content. Third-party widgets + that use a draw() function or a #GtkWidget::draw signal handler for custom + drawing will need to be converted to use gtk_snapshot_append_cairo_node(). + + + The auxiliary #GtkSnapshot object has APIs to help with creating render + nodes. + + + If you are using a #GtkDrawingArea for custom drawing, you need to switch + to using gtk_drawing_area_set_draw_func() to set a draw function. This is + pretty much a direct replacement for a #GtkWidget::draw signal handler. + +
+ -- 2.30.2